Skip to content

Conversation

@melka
Copy link

@melka melka commented Jan 28, 2022

When building for ESP32, the linker scripts were not loaded by zephyr_linker_sources.
This PR fixes that and allows custom linker scripts to be added to the build.

Shoutout to Sylvio on Zephyr discord for the solution.

Signed-off-by: Kamel Makhloufi [email protected]

cvinayak and others added 30 commits September 30, 2021 20:21
Add implementation defined channel index in the auxiliary
pointer of the common extended payload format in the primary
channel PDUs and the same be used in the transmission of
auxiliary PDUs.

Fixes zephyrproject-rtos#35668.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Use defines for aux pointer offset unit value.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Have separate Bluetooth Device address get and read
functions, remove use of function just to return Extended
Advertising Random address and replace with simple
assignment statement.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Verify that the local identity loaded from the settings key is
valid for the current configuration.

Signed-off-by: Joakim Andersson <[email protected]>
Change the way the local IRKs are accessed to be consistent with the
all other uses.
Coverity thinks using the pointer to the array is suspicious in this
case.

Fixes: zephyrproject-rtos#38130

Signed-off-by: Joakim Andersson <[email protected]>
From time to time, measured slice time is one less/more than requested.
Fixes zephyrproject-rtos#35793

Signed-off-by: Alexandre Bourdiol <[email protected]>
Fix deadlock in multiple peripheral connection in a device
due to redundant double reservation of node rx buffer during
crossover scenario in Data Length Update procedure.

Data Length Update resize state was reset back to response
wait state when peripheral received an acknowledgment to
local initiated Data Length Request PDU after having already
transitioned to resize state.

Implementation is designed to transition to resize state
under both Data Length Response reception and crossover
scenario of Data Length Request reception when procedure is
local initiated.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Removed the bt_conn_unref from the deferred_work function.
For ISO, the conn unref for the peripheral will happen in
the bt_iso_disconnected function. For the central, the
unref shall only happen when the CIG is terminated.

Signed-off-by: Emil Gydesen <[email protected]>
Fixes: zephyrproject-rtos#38403

Changing Bluetooth drivers from being a menu into a menuconfig.
This aligns the Bluetooth driver configuration with other driver
configurations as well as provides a setting which identifies if
Bluetooth drivers has been enable.

This further helps to avoid empty Zephyr libraries for bluetooth
samples.

Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#38403

Adding NET_DRIVERS menuconfig so that network drivers are grouped
together in its own menu entry under drivers, similar to most other
drivers.

This further has the advantages that `CONFIG_NET_DRIVERS` can be used
for testing to determine if network drivers has been selected.

This changed revealed a dependency loop where both `select` (for SLIP)
and `depends` (for PPP) which both depends on NET_DRIVERS` where in use
in the dependency tree for Qemu networking, especially NET_SLIP_TAP.

This is handled by defaulting `NET_DRIVERS` to `y` when building for a
Qemu target.
`SLIP` had a dependency to `!QEMU_TARGET || NET_QEMU_SLIP`. This is
changed so that SLIP prompt depends on `!QEMU_TARGET` which provides
full user control in hardware but makes the symbol promptless on Qemu
targets.

Signed-off-by: Torsten Rasmussen <[email protected]>
No sources were ever added to the `zephyr_library()` defined in
modules/hal_nxp/usb/CMakeLists.txt, thus removing this lib to avoid
the warning:

> No SOURCES given to Zephyr library: modules__hal_nxp__usb
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#38403

The two eth_native_posix.c and eth_native_posix_adapt.c are now added
to the common drivers__ethernet Zephyr library.

Instead of creating a dedicated library for just two files those files
are now added to the common ethernet library, see also zephyrproject-rtos#8826.
Instead, the dedicated compile definitions required for those files are
specified using COMPILE_DEFINITIONS on the source files.

This also avoids the following warning as the ethernet library is no
longer empty.

> No SOURCES given to Zephyr library: drivers__ethernet
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#38403

Removing unneeded `imply GPIO` and `CONFIG_GPIO=y` occurrences where no
files are added to the gpio zephyr library.

Also removed `CONFIG_GPIO=y` occurences where this is handled by
defconfigs for the soc or board.

Selection of GPIO without selecting any drivers results in the warning:

> No SOURCES given to Zephyr library: drivers__gpio
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#38403

Removing unneeded `CONFIG_CONSOLES=y` occurrences where no console
driver is selected.

Such selection results in an empty drivers__console zephyr library,
which again results in the following warning message.

> No SOURCES given to Zephyr library: drivers__console
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <[email protected]>
Adding support for automatic testing OOB Authentication method.

Signed-off-by: Agata Ponitka <[email protected]>
This reverts commit 4330929.

Fixes: zephyrproject-rtos#38403

The referred commit introduced `zephyr_library()` for pinmux drivers but
also resulting in zephyrproject-rtos#38403 because several boards has `CONFIG_PINMUX=y`
without selecting any pinmux drivers from `drivers/pinmux` thus
generating the following warning:
> No SOURCES given to Zephyr library: drivers__pinmux
>
> Excluding target from build.

This commit reverts the changes so that this warning disappears.
This results in pinmux drivers from `drivers/pinmux` to be located in
libzephyr.a which is messy, but has been so for a long time, even before
Zephyr 1.14 LTS.

The future pinctrl API will be designed in such a way that this problem
will not occur. Thus the old behavior is acceptable until the transition
to pinctrl API has completed.

Signed-off-by: Torsten Rasmussen <[email protected]>
Allow resolving list update  when passive scanning,
otherwise deny if advertising, active scanning, initiating
or periodic sync create is active.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Use defines for scanning state types of passive, active,
initiator and synchronization state.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Instructions to use openocd on stm32u5 based platforms were missing
an instruction on the branch to use.
Also, the console excerpt were not rendering correctly, so fix
them.

Signed-off-by: Erwan Gouriou <[email protected]>
Update V2.7.0 release notes document with noticeable changes
related to STM32.

Signed-off-by: Erwan Gouriou <[email protected]>
Update V2.7.0 release notes document with noticeable changes
related to shields.

Signed-off-by: Erwan Gouriou <[email protected]>
Add release notes for serial/UART drivers based on commit
history.

Signed-off-by: Daniel Leung <[email protected]>
Add release notes for PCI/PCIe based on commit history.

Signed-off-by: Daniel Leung <[email protected]>
Add release notes for IPM drivers based on commit history.

Signed-off-by: Daniel Leung <[email protected]>
Fix to ignore aux pointer struct in scanning advertising, to
avoid ULL scheduling from setting up ticker to receive chain
PDUs while LLL is receiving scan response PDU.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix asserted in ULL due to incorrect resumption of scan
window when auxiliary channel chain PDU is LLL scheduled by
a ULL scheduled auxiliary channel PDU reception.

The issue is solved by having `is_chain_sched` flag in the
auxiliary channel scan context and using the already present
`is_aux_sched` in the primary channel scan context to
differentiate if the auxiliary PDU Rx ISR is to return back
to primary channel scan window or to close the auxiliary
chain PDU reception radio event.

Relates to zephyrproject-rtos#38146.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
When CTE is enabled for periodic advertising and number of CTE is
greater than number of PDUs in a chain, that are needed to transport
advertising data, there are additional empty PDUs used for transport
CTE.

CTE transmission may be disabled when periodic advertising event is
pending in LLL. rem_cte_info_from_per_adv_chain removed CTEInfo field
from extended advertising header in chained PDUs. When there were found
empty PDUs (created to transport CTE only), they were released from
the chain that was currently used by LLL. That caused an assert in
isr_tx handler due to broken advertising chain.

The rem_cte_info_from_per_adv_chain may not relese PDUs that are in
use by LLL. The PDUs may be released by LLL in prepare step when
advertising pdu double buffer is swapped by lll_adv_sync_data_latest-
_get.

This PR fixes that issue.

Signed-off-by: Piotr Pryga <[email protected]>
Add unit tests that will ensure the CTE disable operation does not
cause breaking of LLL operations by too early release of chained PDUs.
The tests verify if numbers of PDUs in free PDUs fifo and free PDUs
memory pool are correct.

Signed-off-by: Piotr Pryga <[email protected]>
There are two simmilar functions for unsubscribing from GATT handles.

 - `gatt_sub_remove`, which is called on disconnect for every
 subscription will free the `subscriptions` entry when the entry
 represents no subscriptions.

 - `bt_gatt_unsubscribe`, called by the application, which forgets to
 free the `subscriptions` entry.

If all subscriptions grouped in a `subscriptions` entry are removed
using `bt_gatt_unsubscribe` before disconnect, there are no
subscriptions left to call `gatt_sub_remove` on. The `subscriptions`
entry is then never freed.

The above results in a resource leak of a `subscriptions` entry.

This fix makes explicit and enforces the invariant that there should not
be entries in `subscriptions` with an empty subscription list.

Fixes zephyrproject-rtos#38688

Signed-off-by: Aleksander Wasaznik <[email protected]>
Setting of DTC_OVERLAY_FILE as an environment setting was deprecated
before Zephyr 1.14 LTS.

This commit remove the support for this possibility and thus cleans up
the build system.

Signed-off-by: Torsten Rasmussen <[email protected]>
@github-actions
Copy link

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
canopennode zephyrproject-rtos/canopennode@1052dae (zephyr) zephyrproject-rtos/canopennode@f167efe zephyrproject-rtos/[email protected]
fff zephyrproject-rtos/fff@6ce5ba2 (zephyr) N/A N/A
hal_espressif zephyrproject-rtos/hal_espressif@bd2e2d8 zephyrproject-rtos/hal_espressif@3400257 zephyrproject-rtos/[email protected]
hal_gigadevice zephyrproject-rtos/hal_gigadevice@749fdd4 N/A N/A
hal_nordic zephyrproject-rtos/hal_nordic@077031b zephyrproject-rtos/hal_nordic@a6e5299 zephyrproject-rtos/[email protected]
hal_nxp zephyrproject-rtos/hal_nxp@66db7c2 zephyrproject-rtos/hal_nxp@78efc4b zephyrproject-rtos/[email protected]
hal_rp_demo yonsch/hal_rp_demo@master N/A N/A
hal_stm32 zephyrproject-rtos/hal_stm32@6fc9b5f zephyrproject-rtos/hal_stm32@5c82750 zephyrproject-rtos/[email protected]
hal_xtensa zephyrproject-rtos/hal_xtensa@0e57702 (master) zephyrproject-rtos/hal_xtensa@6e1cf3c zephyrproject-rtos/[email protected]
libmetal zephyrproject-rtos/libmetal@f237c9d (master) zephyrproject-rtos/libmetal@39d049d zephyrproject-rtos/[email protected]
mbedtls zephyrproject-rtos/mbedtls@3e3e58a (zephyr) zephyrproject-rtos/mbedtls@5765cb7 zephyrproject-rtos/[email protected]
mcuboot zephyrproject-rtos/mcuboot@225b024 zephyrproject-rtos/mcuboot@70bfbd2 zephyrproject-rtos/[email protected]
mcumgr N/A zephyrproject-rtos/mcumgr@9ffebd5 (v2.7-branch) N/A
open-amp zephyrproject-rtos/open-amp@cfd050f (master) zephyrproject-rtos/open-amp@6010f05 zephyrproject-rtos/[email protected]
openthread zephyrproject-rtos/openthread@41bc49d zephyrproject-rtos/openthread@5d70654 zephyrproject-rtos/[email protected]
psa-arch-tests zephyrproject-rtos/psa-arch-tests@077b8e5 N/A N/A
sof zephyrproject-rtos/sof@500d77e (zephyr) zephyrproject-rtos/sof@76feb11 zephyrproject-rtos/[email protected]
tf-m-tests zephyrproject-rtos/tf-m-tests@93dad5c N/A N/A
trusted-firmware-m zephyrproject-rtos/trusted-firmware-m@7c88781 zephyrproject-rtos/trusted-firmware-m@c74be38 zephyrproject-rtos/[email protected]
zscilib zephyrproject-rtos/zscilib@12bfe3f (master) N/A N/A

Note: This message is automatically posted and updated by the Manifest GitHub Action.

…+rp2040+xtensa+zmk-fixes"

This reverts commit 639ca29, reversing
changes made to fa104e7.
petejohanson pushed a commit that referenced this pull request Jan 4, 2023
This patch reworks how fragments are handled in the net_buf
infrastructure.

In particular, it removes the union around the node and frags members in
the main net_buf structure. This is done so that both can be used at the
same time, at a cost of 4 bytes per net_buf instance.
This implies that the layout of net_buf instances changes whenever being
inserted into a queue (fifo or lifo) or a linked list (slist).

Until now, this is what happened when enqueueing a net_buf with frags in
a queue or linked list:

1.1 Before enqueueing:

 +--------+      +--------+      +--------+
 |#1  node|\     |#2  node|\     |#3  node|\
 |        | \    |        | \    |        | \
 | frags  |------| frags  |------| frags  |------NULL
 +--------+      +--------+      +--------+

net_buf #1 has 2 fragments, net_bufs #2 and #3. Both the node and frags
pointers (they are the same, since they are unioned) point to the next
fragment.

1.2 After enqueueing:

 +--------+      +--------+      +--------+      +--------+      +--------+
 |q/slist |------|#1  node|------|#2  node|------|#3  node|------|q/slist |
 |node    |      | *flag  | /    | *flag  | /    |        | /    |node    |
 |        |      | frags  |/     | frags  |/     | frags  |/     |        |
 +--------+      +--------+      +--------+      +--------+      +--------+

When enqueing a net_buf (in this case #1) that contains fragments, the
current net_buf implementation actually enqueues all the fragments (in
this case #2 and #3) as actual queue/slist items, since node and frags
are one and the same in memory. This makes the enqueuing operation
expensive and it makes it impossible to atomically dequeue. The `*flag`
notation here means that the `flags` member has been set to
`NET_BUF_FRAGS` in order to be able to reconstruct the frags pointers
when dequeuing.

After this patch, the layout changes considerably:

2.1 Before enqueueing:

 +--------+       +--------+       +--------+
 |#1  node|--NULL |#2  node|--NULL |#3  node|--NULL
 |        |       |        |       |        |
 | frags  |-------| frags  |-------| frags  |------NULL
 +--------+       +--------+       +--------+

This is very similar to 1.1, except that now node and frags are
different pointers, so node is just set to NULL.

2.2 After enqueueing:

 +--------+       +--------+       +--------+
 |q/slist |-------|#1  node|-------|q/slist |
 |node    |       |        |       |node    |
 |        |       | frags  |       |        |
 +--------+       +--------+       +--------+
                      |            +--------+       +--------+
                      |            |#2  node|--NULL |#3  node|--NULL
                      |            |        |       |        |
                      +------------| frags  |-------| frags  |------NULL
                                   +--------+       +--------+

When enqueuing net_buf #1, now we only enqueue that very item, instead
of enqueing the frags as well, since now node and frags are separate
pointers. This simplifies the operation and makes it atomic.

Resolves zephyrproject-rtos#52718.

Signed-off-by: Carles Cufi <[email protected]>
petejohanson pushed a commit that referenced this pull request Oct 28, 2025
The "_too_small" test variants intentionally configure an isolated buffer
pool with only 2 buffers to validate proper error handling when the pool
is exhausted during notification of 16 msg_subscriber observers. These
tests are likely to fail on SMP systems due to a buffer recycling race
condition:

Expected behavior (uniprocessor):
  Publisher Thread:
    1. Allocate buf1 for bar_msg_sub1 ✓
    2. k_fifo_put(sub1_fifo, buf1)
    3. Allocate buf2 for bar_msg_sub2 ✓
    4. k_fifo_put(sub2_fifo, buf2)
    5. Try allocate buf3 for bar_msg_sub3 → FAIL -ENOMEM

  Subscriber threads process messages after notification completes,
  pool exhausts at subscriber #3 as expected.

SMP race condition:
  CPU 0 (Publisher):         CPU 1 (bar_msg_sub1):  CPU 2 (bar_msg_sub2):
  ------------------         ---------------------  ---------------------
  Alloc buf1 ✓
  k_fifo_put(sub1, buf1)
                             k_fifo_get() → buf1
                             zbus_sub_wait_msg()
                             net_buf_unref()
                             → buf1 FREED!
  Alloc buf2 ✓
  (reuses buf1!)
  k_fifo_put(sub2, buf2)
                                                    k_fifo_get() → buf2
                                                    net_buf_unref()
                                                    → buf2 FREED!
  Alloc buf3 ✓
  (reuses buf1 again!)
  ...continues...
  All 16 allocations succeed!

On SMP systems, subscriber threads on other CPUs may consume and free
buffers quickly enough that they are recycled back to the pool before the
publisher's notification loop can exhaust it. The test's assumption that
notification completes before subscribers run does not hold with parallel
execution.

Since this is a test design limitation (not a zbus bug), filter SMP
configurations from these specific test variants rather than attempt to
artificially slow down subscribers or change thread priorities.

Signed-off-by: Nicolas Pitre <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment